package com.imgdpicheck.utils;

import com.alibaba.druid.pool.DruidDataSourceFactory;

import javax.sql.DataSource;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;

/**
 * @author xuehu
 * @date 2021/1/28 10:41
 */

public class JdbcUtils {

    public static Connection getOracleConnection() throws Exception {
        Properties pros = new Properties();


//        InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("druid.properties");

        InputStream is = new FileInputStream(new File("druid.properties"));

        pros.load(is);


        DataSource source = DruidDataSourceFactory.createDataSource(pros);
        Connection conn = source.getConnection();

        return conn;
    }

}
